package com.example.myapplication;

import android.animation.ValueAnimator;
import android.renderscript.Sampler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    private  MyCircle myCircle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        myCircle=findViewById(R.id.myCirlce);
        int progress=88;
        ValueAnimator valueAnimator=ValueAnimator.ofInt(0,progress);
        valueAnimator.setDuration(3000);
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator animation) {
                int value=(int) animation.getAnimatedValue();
                myCircle.setPorgress(value);
            }
        });
        valueAnimator.start();
    }
}
